/*
@hehung
email: 1398660197@qq.com
wechat: hehung95
reproduced and please indicate the source @hehung
*/

#ifndef APP_COMMON_H_
#define APP_COMMON_H_

#include "hal_data.h"
#include "FreeRTOS.h"
#include "task.h"

// include all header files
#include "app_display.h"
#include "app_oled.h"
#include "app_rtc.h"
#include "app_adc.h"
#include "app_hs300x.h"
#include "app_led.h"
#include "app_hw_i2c.h"
#include "app_uart.h"
#include "app_rtc.h"
#include "app_wifi.h"
#include "app_wifi_esp8266.h"
#include "app_max30102.h"
#include "app_beep.h"
#include "app_warning.h"
#include "app_eeprom.h"


#include <stdio.h>
#include <string.h>




#define FREERTOS_OS                 (1U)

#ifndef FREERTOS_OS
#define DELAY_MS(ms)                R_BSP_SoftwareDelay(ms, BSP_DELAY_UNITS_MILLISECONDS);
#else
#define DELAY_MS(ms)                vTaskDelay(pdMS_TO_TICKS(ms));
#endif




#define COMM_ON                     (0)
#define COMM_OFF                    (1)





// uart printf for debug
#define COMM_DEBUG  




#ifdef COMM_DEBUG
#include <stdio.h>
// uart printf
#define COMM_PRINT(fmt, ...)             printf(fmt, ##__VA_ARGS__)
// log for uart printf
#define COMM_LOG(fmt, ...)
#endif /* COMM_DEBUG */




// event group flags
#define EVENT_GROUP_SET_BIT(bit)    ((1U << (bit)) & 0x00FFFFFFU)
#define EVENT_GROUP_0_INIT          (0) 
#define EVENT_GROUP_1_MAX30102      (1)



#endif /* APP_COMMON_H_ */
